package com.observer.demo2.main;

import java.util.Observable;
import com.observer.demo2.impl.CurrentConditionsDisplay;
import com.observer.demo2.impl.OtherDisplay;
import com.observer.demo2.impl.WeatherData;

/**
 * 利用java内置的观察者模式
 * 
 * @author dell
 * 
 */
public class WeatherStation extends Observable {

	@SuppressWarnings("unused")
	public static void main(String[] args) {
		WeatherData weatherData = new WeatherData();
		CurrentConditionsDisplay currentDisplay = new CurrentConditionsDisplay(
				weatherData);
		OtherDisplay otherDisplay2 = new OtherDisplay(weatherData);

		// 模拟新的气象测量
		weatherData.setMeasurements(80, 65, 30.4f);
		weatherData.setMeasurements(82, 70, 29.2f);
		weatherData.setMeasurements(78, 90, 29.2f);
	}

}
